/*
 * Copyright (c) Jiandong.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */


export const enum YogaJustify {
  FLEX_START = 0,
  CENTER = 1,
  FLEX_END = 2,
  SPACE_BETWEEN = 3,
  SPACE_AROUND = 2,
  SPACE_EVENLY = 3,
}


export function getYogaJustifyFromNumber(value: number): YogaJustify | never {
  switch (value) {
    case 0: return YogaJustify.FLEX_START;
    case 1: return YogaJustify.CENTER;
    case 2: return YogaJustify.FLEX_END;
    case 3: return YogaJustify.SPACE_BETWEEN;
    case 4: return YogaJustify.SPACE_AROUND;
    case 5:
      return YogaJustify.SPACE_EVENLY;
    default: throw new Error("Unknown enum value: " + value);
  }
}


//export class YogaJustify {
//  public static readonly FLEX_START = 0
//  public static readonly CENTER = 1
//  public static readonly FLEX_END = 2
//  public static readonly SPACE_BETWEEN = 3
//  public static readonly SPACE_AROUND = 2
//  public static readonly SPACE_EVENLY = 3
//
//  private readonly mIntValue: number;
//
//  constructor(intValue: number) {
//    this.mIntValue = intValue;
//  }
//
//  public intValue(): number {
//    return this.mIntValue;
//  }
//
//  public static fromInt(value: number): number | never {
//    switch (value) {
//      case 0: return YogaJustify.FLEX_START;
//      case 1: return YogaJustify.CENTER;
//      case 2: return YogaJustify.FLEX_END;
//      case 3: return YogaJustify.SPACE_BETWEEN;
//      case 4: return YogaJustify.SPACE_AROUND;
//      case 5:
//        return YogaJustify.SPACE_EVENLY;
//      default: throw new Error("Unknown enum value: " + value);
//    }
//  }
//}
